package cn.iocoder.yudao.module.team.dal.mysql.fleet;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.team.dal.dataobject.fleet.FleetDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.team.controller.admin.fleet.vo.*;

/**
 * 团队管理-车队信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface FleetMapper extends BaseMapperX<FleetDO> {

    default PageResult<FleetDO> selectPage(FleetPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FleetDO>()
                .likeIfPresent(FleetDO::getDriverName, reqVO.getDriverName())
                .likeIfPresent(FleetDO::getFleetName, reqVO.getFleetName())
                .eqIfPresent(FleetDO::getFleetType, reqVO.getFleetType())
                .eqIfPresent(FleetDO::getFleetNumber, reqVO.getFleetNumber())
                .eqIfPresent(FleetDO::getDriverPhone, reqVO.getDriverPhone())
                .eqIfPresent(FleetDO::getValue1, reqVO.getValue1())
                .eqIfPresent(FleetDO::getValue2, reqVO.getValue2())
                .eqIfPresent(FleetDO::getValue3, reqVO.getValue3())
                .eqIfPresent(FleetDO::getValue4, reqVO.getValue4())
                .betweenIfPresent(FleetDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FleetDO::getId));
    }

}